package com.thz.houserental.infrastructure.auth;

import com.thz.houserental.infrastructure.table.User;
import lombok.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

@Setter
@Getter
public class UserDetail 
        extends org.springframework.security.core.userdetails.User 
        implements UserDetails {
    private User user;
    
    public UserDetail(User userEntity, Collection<? extends GrantedAuthority> authorities) {
        super(userEntity.getNickName(), userEntity.getPassword(), authorities);
        this.user = userEntity;
    }
}
